package dmt16.TelemetrySuit.Utils
{
	import flash.geom.Point;
	
	public class GPSpoint extends Point
	{
		public function GPSpoint(lat:String="",NorthSouth:String="N",lon:String="",EastWest:String="E"){
			if(lat.length==8&&lon.length==9){
				var x_deg:Number=Number(lat.substr(0,2));
				var y_deg:Number=Number(lon.substr(0,3));
				var x_min:Number=Number(lat.substr(2));
				var y_min:Number=Number(lon.substr(3));
				this.x=(NorthSouth=="S"?-1:1)*(x_deg+x_min/60);
				this.y=(EastWest=="W"?-1:1)*(y_deg+y_min/60);
			}
		}
	}
}